home *** CD-ROM | disk | FTP | other *** search
- on SetHT listPara, Op
- global listHT
- if (paramCount() <> 2) or (listHT = list()) then
- set listHT to list(0, 0, 0)
- end if
- set Pz to 2
- repeat with compt = 1 to count(listPara) / 4
- add(listHT, getAt(listPara, Pz))
- add(listHT, getAt(listPara, Pz + 1))
- set NumCast to getAt(listPara, Pz + 2)
- if stringp(NumCast) then
- set NumCast to the number of cast NumCast
- end if
- add(listHT, NumCast)
- add(listHT, getAt(listPara, Pz + 3))
- set Pz to Pz + 4
- end repeat
- setAt(listHT, 1, count(listHT) / 4)
- setAt(listHT, 3, getAt(listPara, 1))
- end
-
- on AjouteHT listPara
- SetHT(listPara, 1)
- end
-
- on KillHT
- global listHT
- set listHT to list()
- end
-
- on GetLastHTfound
- global listHT
- return getAt(listHT, getAt(listHT, 2) * 4)
- end
-
- on GetLastNumHTfound
- global listHT
- return getAt(listHT, 2)
- end
-
- on ClicHT
- global listHT
- if listHT = list() then
- exit
- end if
- set PisteCast to getAt(listHT, 3)
- if PisteCast <> 0 then
- puppetSprite(PisteCast, 1)
- set the castNum of sprite PisteCast to -1
- end if
- set PisteClic to the clickOn
- if PisteClic = 0 then
- exit
- end if
- set NumCast to the castNum of sprite PisteClic
- if the castType of cast NumCast <> #text then
- exit
- end if
- set Champs to the text of cast NumCast
- set NumWord to the mouseWord
- if NumWord = -1 then
- exit
- end if
- set LastWord to word NumWord of Champs
- set NumChar to the mouseChar
- set Pz to 4
- repeat with compt = 1 to getAt(listHT, 1)
- if (offset(LastWord, getAt(listHT, Pz)) <> 0) or (offset(LastWord & "s", getAt(listHT, Pz)) <> 0) then
- set TextCible to getAt(listHT, Pz)
- set LenTC to length(TextCible)
- set ChampsTest to char NumChar - LenTC to NumChar + LenTC of Champs
- set PosDeb to offset(TextCible, ChampsTest)
- if PosDeb <> 0 then
- set OpOk to 1
- if the number of words in TextCible <> 1 then
- set Deca to PosDeb - 1
- repeat with X = 1 to the number of chars in TextCible
- if char X of TextCible <> char Deca + X of ChampsTest then
- set OpOk to 0
- exit repeat
- end if
- end repeat
- end if
- if OpOk = 1 then
- setAt(listHT, 2, compt)
- set CastAff to getAt(listHT, Pz + 2)
- if CastAff <> -1 then
- set ParaPos to getAt(listHT, Pz + 3)
- if ParaPos <> "#" then
- set PosX to value(word 1 of ParaPos)
- set PosY to value(word 2 of ParaPos)
- if offset("Mouse", ParaPos) <> 0 then
- set PosX to PosX + the mouseH
- set PosY to PosY + the mouseV
- end if
- set the locH of sprite PisteCast to PosX
- set the locV of sprite PisteCast to PosY
- end if
- set the castNum of sprite PisteCast to CastAff
- end if
- set NomMacro to getAt(listHT, Pz + 1)
- if NomMacro <> "#" then
- CallM(NomMacro)
- end if
- end if
- end if
- end if
- set Pz to Pz + 4
- end repeat
- end
-